package com.aqie.haikang.dorm.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * @Author aqie
 * @Date 2021/12/11 9:21
 * @desc
 */
@Entity
@Table(name = "c_hk_enter")
@Data
public class HkEnter {
    @Id
    @Column(updatable = false, nullable = false)
    private Long id;

    @Column(nullable = false)
    private String tenantId = "528663";

    /**
     * 用户唯一号
     */
    @Column(nullable = false)
    private String code;

    @Column(nullable = false)
    private String name;

    /**
     * 宿舍楼编号
     */
    @Column(nullable = false)
    private String buildingNum;

    /**
     * 进出状态 0-进 1-出
     */
    @Column(nullable = false)
    private byte status;

    /**
     * 对比状态 1-成功 2-失败
     */
    @Column(nullable = false)
    private byte contrastStatus;

    /*@Column(nullable = false)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;*/

    @JsonSerialize(using = ToStringSerializer.class)
    private Long createTime;
}
